home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Science
/
RLaB
/
misc
/
configure.in
< prev
next >
Wrap
Text File
|
1994-04-25
|
6KB
|
252 lines
dnl configure.in for RLaB
dnl Process this file with autoconf to prodice a configure script
dnl The following bit of shell script was shamelessly borrowed
dnl from the GNU emacs configure.in
[#!/bin/sh
progname="`echo $0`"
## Usage messages.
short_usage="Usage: ${progname} [--with-LIBS=dir] ...
Set compilation and installation parameters for RLaB.
--with-LIBS=DIR Add DIR to list of directories to search for
ALL libraries.
--with-NALIBS=DIR Search for Numerical Analysis libraries in DIR.
--with-FLIBS=DIR Search for Fortran libraries in DIR.
--with-PLIBS=DIR Search for PLPLOT Library in DIR
--with-gcc Force usage of the GNU C compiler.
--with-cc Force usage of cc(1)
--prefix=DIR Set the Makefile variable \'prefix\' to DIR.
RLaB will be installed with DIR as the root
directory.
If successful, ${progname} leaves its status in config.status. If
unsuccessful after disturbing the status quo, it removes config.status."
]
AC_INIT(rlab.h)
AC_CONFIG_HEADER(config.h)
dnl Set default library search path
AC_WITH(LIBS,
[
LIBS="-L$withval "
LLIBS="-L$withval "
],
[
LIBS="-L/usr/local/lib "
LLIBS="-L/usr/local/lib "
])
dnl Find the necessary programs
AC_PROG_YACC
dnl Flex is required
AC_PROGRAM_CHECK(FLEX, flex, flex)
dnl AC_HAVE_LIBRARY(fl, [FLEX_LIB="$LIBS -lfl"],
dnl [
dnl echo "WARNING: you must have the flex library libfl.a"
dnl ])
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROGRAM_CHECK(F2C, f2c, f2c)
dnl Check to see if `--with-cc' or `--with-gcc'
dnl was specified on the command line.
AC_WITH(cc, [CC="cc"])
AC_WITH(gcc, [CC="gcc" GCC=1])
[
if test -z "$CC" ; then
] AC_PROG_CC [
fi
]
dnl Determine the compiler characteristics
AC_CONST
AC_SIZE_T
AC_WORDS_BIGENDIAN
AC_PROGRAM_CHECK(PAGER, less, less)
[
if test -z "$PAGER" ; then
] AC_PROGRAM_CHECK(PAGER, more, more) [
if test -z "$PAGER" ; then
] AC_PROGRAM_CHECK(PAGER, pg, pg) [
fi
fi
]
dnl Look for certain problematic platforms
AC_PROGRAM_EGREP(yes,
[#ifdef titan
yes
#endif
], TITAN=1)
AC_HEADER_CHECK(elf.h, AC_DEFINE(SVR4))
dnl Find the REQUIRED numerical libraries
dnl They are probably all in /usr/local/lib
AC_WITH(NALIBS,
[
echo "look for Numerical Analysis LIBS in $withval"
LIBS="$LIBS -L$withval"
NALIB_DIR="-L$withval "
],
[
NALIB_DIR=""
])
AC_HAVE_LIBRARY(Clapack, [NALIBS="$NALIB_DIR -lClapack"], [
echo "WARNING: Cannot find libClapack.a, use --with-NALIBS option" ])
AC_HAVE_LIBRARY(Cblas, [NALIBS="$NALIBS -lCblas"], [
echo "WARNING: Cannot find libCblas.a, use --with-NALIBS option" ])
AC_HAVE_LIBRARY(Cfftpack, [NALIBS="$NALIBS -lCfftpack"], [
echo "WARNING: Cannot find libCfftpack.a, use --with-NALIBS option" ])
AC_HAVE_LIBRARY(Cranlib, [NALIBS="$NALIBS -lCranlib"], [
echo "WARNING: Cannot find libCranlib.a, use --with-NALIBS option" ])
dnl Get libreadline.a if available
AC_HAVE_LIBRARY(readline, [CMDLIBS="$LIBS -lreadline"], [READLINE="no"])
[
if test -z "$READLINE" ; then
] AC_DEFINE(HAVE_READLINE,1)
AC_HAVE_LIBRARY(termcap, [CMDLIBS="$CMDLIBS -ltermcap"]) [
fi
]
dnl Find the REQUIRED f2c libraries
dnl First look for libf2c.a, then for libF77.a, and libI77.a
dnl if neccesary.
AC_WITH(FLIBS,
[
echo "look for F2C LIBS in $withval"
LIBS="$LIBS -L$withval"
FLIB_DIR="-L$withval"
],
[
FLIB_DIR=""
])
AC_HAVE_LIBRARY(f2c, [FLIBS="$FLIB_DIR -lf2c"])
[
if test -z "$FLIBS" ; then
] AC_HAVE_LIBRARY(F77, [FLIBS="$FLIB_DIR -lF77"])
AC_HAVE_LIBRARY(I77, [FLIBS="$FLIBS -lI77"]) [
if test -z "$FLIBS" ; then
echo "WARNING: Cannot find Fortran libraries, use --with-FLIBS option"
fi
fi
]
dnl
dnl Look for PLPLOT libraries
dnl
dnl 1st set X11LIB variable
[
X11LIB="-lX11"
]
AC_HAVE_LIBRARY(nsl, [NSL=true])
[
if test -n "$NSL" ; then
LIBS="$LIBS -lnsl"
]
AC_HAVE_LIBRARY(socket, [X11LIB="$X11LIB -lsocket -lnsl"])
[
fi
]
AC_WITH(PLIBS,
[
echo "look for PLPLOT library $withval"
LIBS="$LIBS -L$withval"
PLIB_DIR="-L$withval"
PLIB_INC="$withval"
],
[
LIBS="$LIBS -L/usr/local/plplot"
PLIB_DIR="-L/usr/local/plplot"
PLIB_INC="/usr/local/plplot"
])
AC_HAVE_LIBRARY(plplotdX, [PLIBS="$PLIB_DIR -lplplotdX $X11LIB"])
[
if test -z "$PLIBS" ; then
] AC_HAVE_LIBRARY(plplotdtk,
[PLIBS="$PLIB_DIR -lplplotdtk -ltk -ltcl $X11LIB"]) [
fi
]
[
if test -n "$PLIBS" ; then
] AC_DEFINE(HAVE_RLAB_PLPLOT,1) [
PLOT_PROG="plplot"
PLIB_INC_DIR="-I$PLIB_INC/include"
else
] AC_PROGRAM_CHECK(PLOT_PROG, gnuplot, gnuplot, nothing) [
PLIB_INC_DIR=""
fi
]
[
if test -z "$TITAN" ; then
] AC_STDC_HEADERS
AC_DIR_HEADER
AC_HAVE_HEADERS(stdlib.h time.h float.h ieeefp.h unistd.h)
dnl Look for certain functions
AC_HAVE_LIBRARY(m)
AC_HAVE_FUNCS(difftime rint rindex matherr fpsetmask)
AC_ALLOCA
AC_HEADER_EGREP([ rint], math.h, AC_DEFINE(HAVE_RINT_DEC,1))
[
else
] dnl Titan P3
AC_DEFINE(TITAN, 1)
AC_DIR_HEADER
AC_HAVE_HEADERS(stdlib.h time.h unistd.h)
dnl Look for certain functions
AC_HAVE_LIBRARY(m)
AC_HAVE_FUNCS(difftime rint rindex)
AC_ALLOCA [
fi
]
AC_COMPILE_CHECK([fprintf dec],[#include <stdio.h>],
[int (*x)()=(int(*)())fprintf;],
AC_DEFINE(HAVE_FPRINTF_DEC))
AC_COMPILE_CHECK([sprintf dec],[#include <stdio.h>],
[int (*x)()=(int(*)())sprintf;],
AC_DEFINE(HAVE_SPRINTF_DEC))
dnl Now do checks for getline command-line interface.
dnl Getline needs to know if termios exists
dnl AC_HEADER_CHECK(termios.h)
AC_SUBST(CC)
AC_SUBST(F2C)
AC_SUBST(FLEX)
dnl AC_SUBST(FLEX_LIB)
AC_SUBST(PAGER)
AC_SUBST(LLIBS)
AC_SUBST(NALIBS)
AC_SUBST(FLIBS)
AC_SUBST(CMDLIBS)
AC_SUBST(PLIBS)
AC_SUBST(PLOT_PROG)
AC_SUBST(PLIB_INC_DIR)
dnl done, write the Makefile
AC_OUTPUT(Makefile)